package com.jiedeng.mapper;

import com.jiedeng.entity.PersonDetails;
import com.jiedeng.mapper.provider.PersonSqlProvider;
import com.jiedeng.model.Person;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

@Mapper
public interface PersonMapper {

    @Results({
            @Result(column = "Post_Caption", property = "postCaption"),
            @Result(column = "Corp_Id",property ="corpId"),
            @Result(column = "Person_ID", property = "personId"),
    })
    @SelectProvider(type = PersonSqlProvider.class, method = "personCountList")
    List<PersonDetails> personCountList(String corpId, String page, String pageSize);

    @SelectProvider(type = PersonSqlProvider.class, method = "personCountNum")
    int personCountNum(String corpId);

    @Results({
            @Result(column = "Person_ID", property = "personId"),
    })
    @SelectProvider(type = PersonSqlProvider.class, method = "personEdit")
    List<PersonDetails> personEdit(String personId);

}
